home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Creative Computers
/
Creative Computers CD-ROM, Volume 1 (Legendary Design Technologies, Inc.)(1994).iso
/
text
/
info
/
ansi_color
< prev
next >
Wrap
Text File
|
1994-11-17
|
4KB
|
151 lines
ANSI Colour in Messages
~~~~~~~~~~~~~~~~~~~~~~~
=============================================================================
It seems there are several people interested in knowing how to insert
colour into their messages, so....
ANSI COLOUR:
ANSI (American National Standards Institute) colour is a neat way to spritz
up your messages. It usually allows up to 8 colours (depends on your term)
as well as boldface, underline, italics and inverse. It's also got a
practical aspect to it, since you can use it emphasize points or words.
This particular method of inserting colour/style only works on certain BBS
programs, namely PCBoard (any version) and FoReM (any version). I have
attempted it on several other BBS programs (BBS-PC, Opus, FCP, etc) to no
avail, but if anyone manages to get it working, give me a shout!
Now, on with it....
The colour in messages is controlled by escape sequences (they start with
the escape code), and takes up line room. This means that while you won't
see the sequence, it will count in your "number of characters per line",
and it's likely that if you use a lot of codes on the same line that it
will wrap over to the next line fairly soon. Be Warned!
The format of the colour/style sequence is as follows:
-----
ESC[s;ff;bb;m
-----
ESC is the ESCAPE key.
[ is the left square bracket
s is the STYLE number
; is a semi-colon
ff is the FOREGROUND (letter) colour
bb is the BACKGROUND colour
m is the letter "m" and is the terminator, signifies end of code
You're probably wondering what all these numbers are. So...
STYLE NUMBERS:
0 - Plain Text
1 - Bold Face
3 - Italic
4 - Underline
7 - Inverse
FOREGROUND NUMBERS:
30 - Colour 1 (background colour)
31 - " " 2 (standard text colour)
32 - " " 3
33 - " " 4
34 - " " 5
35 - " " 6
36 - " " 7
37 - " " 8
BACKGROUND NUMBERS:
40 - Colour 1 (background colour )
41 - " " 2 (standard text colour)
42 - " " 3
43 - " " 4
44 - " " 5
45 - " " 6
46 - " " 7
47 - " " 8
The colours you'll be seeing will depend one your setup. If you use
Online!, the colours are set and you can't change them (short of hacking
Online, something not recommended ;-). Terms like AZcomm use only 4
colours, and those are controlled by your WB/Preferences colours. The best
terms for this application are the ones that allow you to change the colour
palette, such as GT or Access!.
NOTE: I have experianced some trouble with ESCAPE on Online! 2.11, am
working on it and will get info shortly..
When you type the sequence in, you won't see it echo on your screen. After
terminating it with an "m", continue typing your msg and you should see the
new colour/style. To revert back to normal colour/style, type in the
escape sequence:
-----
ESC[0m
-----
That resets everything back to normal. ALWAYS USE THIS BEFORE YOU END A
MESSAGE, or you'll leave the reader in that particular colour/style for all
his text!
** NOTE ** - NEVER use the background colour and not reset it. This makes
all the text after it INVISIBLE, and is an extremely rude
thing to do to someone.
If you only want to change the style, or only the foreground (letter)
colour, or only the background, or any other combos, it is not necessary to
include all 3 numbers. If you just want one of the 3, then it would go
something like:
-----
ESC[xxm
-----
xx is any one of the numbers (style, foreground or background)
m is the terminator
Here are some examples of colour/style changes, to help you out:
ESC[3;34;42m - This will turn on ITALICS, change the letter colour
to the 5th colour and change the background colour
to the 3rd colour.
ESC[4;32m - This will turn on UNDERLINE and change the letter
colour to the 3rd colour.
ESC[1;43m - This will turn on BOLDFACE and change the background
colour to the 4th colour.
ESC[36m - This will change the letter colour to the 7th color.
ESC[7m - This will turn on INVERSE.
ESC[0m - This will turn everything back to normal.
Hope this has helped SOMEONE!